/**
 * 
 * @author Matthew Dye
 *
 * @param <K>
 * 
 * This class represents a node for a HashTable or array that holds a key and value for lookup.
 */
public class HashNode<K,V> {

	private K key;
	private V value;
	private HashNode<K,V> next;
	
	HashNode(K key, V value)
	{
		this.key = key;
		this.value = value;
		next = null;
	}
	
	/**
	 * Sets the next value top the nede passed in
	 * @param node The new node
	 */
	public void setNext(HashNode<K,V> node)
	{
		this.next = node;
	}
	/**
	 * Sets the key value of the node to the passed in value
	 * @param key new key value
	 */
	public void setKey(K key)
	{
		this.key = key;
	}
	/**
	 * Sets the value of value of the current node to the passed in value
	 * @param value The new value
	 */
	public void setValue(V value)
	{
		this.value = value;
	}
	/**
	 * Returns the key value of the node
	 * @return
	 */
	public K getKey()
	{
		return key;
	}
	/**
	 * returns the value of the node
	 * @return
	 */
	public V getValue()
	{
		return value;
	}
	/**
	 * Returns the HashNode held in the next location
	 * @return
	 */
	public HashNode<K,V> getNext()
	{
		return next;
	}
}
